package com.sf.fy.uav.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sf.fy.uav.common.request.operate.ActivityAddRequest;
import com.sf.fy.uav.common.request.operate.ActivityEditRequest;
import com.sf.fy.uav.common.request.operate.SysActivityRequest;
import com.sf.fy.uav.common.request.order.DealRequest;
import com.sf.fy.uav.common.response.operational.SysActivityResponse;
import com.sf.fy.uav.entity.Activity;
import com.sf.fy.uav.entity.ActivityRewardRules;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 活动表 服务类
 * </p>
 *
 * @author LTQ
 * @since 2023-08-16
 */
public interface IActivityService extends IService<Activity> {
    /**
     * 添加活动
     *
     * @param activityAddRequest
     */
    void addActivity(ActivityAddRequest activityAddRequest);

    /**
     * 添加活动
     *
     * @param activityEditRequest
     */
    void editActivity(ActivityEditRequest activityEditRequest);

    /**
     * 查询总条数
     *
     * @param name
     * @param status
     * @return
     */
    Long getTotal(String name, Integer status);

    /**
     * 查询banners
     *
     * @param sysActivityRequest
     * @return
     */
    List<SysActivityResponse> getActivity(SysActivityRequest sysActivityRequest);

    /**
     * 下架
     *
     * @param dealRequest
     */
    void off(@RequestBody DealRequest dealRequest);

    /**
     * 下架
     *
     * @param dealRequest
     */
    void delete(@RequestBody DealRequest dealRequest);

    /**
     * 通过类型获取
     *
     * @param type
     * @return
     */
    BigDecimal getByType(@RequestParam(required = false) Integer type);

    /**
     * 获取活动设置
     *
     * @param type
     * @return
     */
    Activity getSettings(Integer type);

    /**
     * 获取活动设置
     *
     * @param activityId
     * @return
     */
    Activity getSettings(String activityId);

    /**
     * 检查活动有效性
     *
     * @param activityId
     * @return
     */
    Boolean checkEffectiveness(String activityId);

    void autoLoadAndUnload();


    /**
     * 通过产品类型和活动id获取活动
     *
     * @param productType 产品类型
     * @param activityId  活动id
     * @return 奖励规则
     */
    ActivityRewardRules getSettingsByProductType(Byte productType, String activityId);
}
